<?
require_once('ConverterBase.php');

require_once('ri/filesys/File.php');

class FileConverter extends ConverterBase {
	protected function toDatatype($string) {
		if (is_array($string)) {
			if (!empty($string['error']))
				throw new ConverterException($this,'file_upload_error',$string['error']);
			return new File($string['tmp_name']);
		}
		else return new File($string);
	}
	protected function toString($object) {
		return $object->getLocation();
	}
}
